﻿using Gateway.Domain.EFCore.Configuration;
using Gateway.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Gateway.Domain.Configuration;

public class LanguageConfiguration : AggregateRootEntityConfiguration<Language>
{
    public override void Configure(EntityTypeBuilder<Language> builder)
    {
        builder.ToTable(t => t.HasComment("运行语言配置表"));
        builder.Property(x => x.Lang).HasMaxLength(50).IsRequired().HasComment("语言类型 csharp java c c++ 等");
        builder.Property(x => x.Text).HasMaxLength(100).IsRequired().HasComment("名称-显示");
        builder.Property(x => x.LangType).HasMaxLength(50).IsRequired()
            .HasComment("语言的编译类型   Compiled 编译型  Interpretation 解释型");
        builder.Property(x => x.Build).HasMaxLength(500).HasComment("构建使用的主命令");
        builder.Property(x => x.BuildCommand).HasMaxLength(1000).HasComment("构建使用的命令");
        builder.Property(x => x.Exec).HasMaxLength(500).IsRequired().HasComment("执行的主命令");
        builder.Property(x => x.ExecCommand).HasMaxLength(1000).IsRequired().HasComment("执行的使用的命令");
        base.Configure(builder);
    }
}